along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ 2009-09-06 | Josef Reisinger | Added "set target location", i.e. -i skytrag,targetlocation=<lat>:<lng>
*/
#include <ctype.h>
static char *opt_initbaud; /* baud rate used to init device */
static char *opt_dlbaud; /* baud rate used for downloading tracks */
static char *opt_read_at_once; /* number of sectors to read at once (Venus6 only) */
+static char *opt_set_location; /* set if the "targetlocation" options was used */
static
arglist_t skytraq_args[] = {
"230400", ARGTYPE_INT, "4800", "230400" },
{ "read-at-once", &opt_read_at_once, "Number of sectors to read at once (Venus6 only)",
"255", ARGTYPE_INT, "0", "255" },
+ { "targetlocation", &opt_set_location, "Set location finder target location as lat,lng",
+ "", ARGTYPE_STRING, "", "" },
ARG_TERMINATOR
};
return res_OK;
}
+static void
+skytraq_set_location(void)
+{
+ double lat, lng;
+ int i;
+ gbuint8 MSG_SET_LOCATION[17] = { 0x36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ gbuint8 MSG_GET_LOCATION = 0x35;
+
+ db(3, MYNAME ": set_location='%s'\n", opt_set_location);
+
+ sscanf(opt_set_location, "%lf:%lf", &lat, &lng);
+ le_write_double(&MSG_SET_LOCATION[1], lat);
+ le_write_double(&MSG_SET_LOCATION[9], lng);
+ for (i=0; i<sizeof MSG_SET_LOCATION; i++) {
+ db (3, "%02x ", MSG_SET_LOCATION[i]);
+ }
+ db(3, "\n");
+ if (skytraq_wr_msg_verify((gbuint8*)&MSG_SET_LOCATION, sizeof(MSG_SET_LOCATION)) != res_OK) {
+ fatal(MYNAME ": cannot set new location\n");
+ }
+ {
+ char buf[32];
+ skytraq_wr_msg_verify(&MSG_GET_LOCATION, 1);
+ skytraq_rd_msg(buf, 32);
+ }
+}
/*******************************************************************************
* %%% global callbacks called by gpsbabel main process %%% *
int dlbaud;
route_head *track;
+ if (*opt_set_location) {
+ skytraq_set_location();
+ return;
+ }
track = route_head_alloc();
track->rte_name = xstrdup("SkyTraq tracklog");
track->rte_desc = xstrdup("SkyTraq GPS tracklog data");
--- /dev/null
+<para>
+ The device provides a location finder built from eight LEDs and can use
+ those LEDs to guide you to a location. You can set the target location
+ with the 'targetlocation' option. Use ':' as the delimiter between latitude
+ and longitude.
+</para>
+<example id="skytraq-targetlocation">
+ <title>Set the target location of the Skytraq location finder</title>
+ <para>
+ <userinput>gpsbabel -i skytraq,targetlocation=12.34:-56.78 -f /dev/ttyUSB
+0 -o unicsv -F -</userinput>
+ Sets latitude and longitude of the location finder to N12.34 and
+ W56.78 re ectivly.
+ The arrows on the device will point you to this location as soon as
+ it h as a satlitte fix.
+ </para>
+</example>
+